#!/opt/midware/python3/bin/python3
# -*- coding: utf-8 -*-
# @Time    : 2024/12/24 13:15
# @File    : c.py
# @Software: PyCharm


import asyncio
import websockets
# loop = asyncio.new_event_loop()
# asyncio.set_event_loop(loop)

async def hello():
    uri = "ws://127.0.0.1:9090"
    async with websockets.connect(uri) as websocket:
        print(websocket)

        # name = input("What's your name? ")
        name = "123"
        await websocket.send(name)
        response = await websocket.recv()
        print(f"Received message: {response}")

# asyncio.run(hello())

# loop.run_until_complete(hello())
asyncio.run(hello())
